package listener;

import com.mysql.cj.Session;
import dao.FixDaoImpl;
import utils.string.session.SessionStringUtil;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import java.util.HashMap;

public class AllFixListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        FixDaoImpl fixDao = new FixDaoImpl();
        HashMap fixs =fixDao.selectAll();
        HttpSession session = se.getSession();
        session.setAttribute(SessionStringUtil.ALL_FIXED_EQUIPMENTS,fixs);
    }
}
